// @ts-ignore
/* eslint-disable */
import request from "@/api/http.js";

/** 此处后端没有提供注释 POST /category/add */
export async function addCategory(
  body: API.CategoryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/category/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /category/id */
export async function getCategoryIdByName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCategoryIdByNameParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/category/id", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /category/list */
export async function getCategoryList(options?: { [key: string]: any }) {
  return request<API.BaseResponseListCategory>("/category/list", {
    method: "GET",
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /category/name */
export async function getCategoryNameById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCategoryNameByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseString>("/category/name", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
